98e13f70a11eef988b9c914932a1cc5405e050b9,multipicker/src/main/java/com/kbeanie/multipicker/core/VideoPickerImpl.java,VideoPickerImpl,takeVideoWithCamera,#,78
Before Change
protected String takeVideoWithCamera() throws PickerException {
String tempFilePath = buildFilePath("mp4", Environment.DIRECTORY_MOVIES);
Uri uri = Uri.fromFile(new File(tempFilePath));
Intent intent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);
intent.putExtra(MediaStore.EXTRA_OUTPUT, uri);
if (extras != null) {
After Change
protected String takeVideoWithCamera() throws PickerException {
Uri uri = null;
String tempFilePath;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
tempFilePath = getNewFileLocation("mp4", Environment.DIRECTORY_MOVIES);
File file = new File(tempFilePath);
uri = FileProvider.getUriForFile(getContext(), "com.kbeanie.multipicker", file);
Log.d(TAG, "takeVideoWithCamera: Temp Uri: " + uri.getPath());
} else {
tempFilePath = buildFilePath("mp4", Environment.DIRECTORY_MOVIES);
uri = Uri.fromFile(new File(tempFilePath));
}
Intent intent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);
intent.putExtra(MediaStore.EXTRA_OUTPUT, uri);